package com.example.wxy2.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result {
    private boolean success;
    private String username;
    private String msg;
    private int code;
    public static Result success(String data){
        return new Result(true, data, "success", 200);
    }

    public static Result fail(int code,String msg){
        return new Result(false, null, msg, code);
    }

}
